package com.wbl.train.common.member.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import java.time.LocalDate;
import java.time.LocalTime;
import java.util.Date;

import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.experimental.Accessors;

/**
 * @author 王博纶
 * @since 2024-03-07
 * @description 车票
 */
@Data
@Accessors(chain = true)
@Schema(name = "Ticket 对象", description = "车票 实体类")
@TableName("ticket") // 设置实体的别名 --- 否则使用mybatisPlus查询的时候会报错
public class TicketEntity {

    @Schema(description = "id")
    @TableId(value = "id", type = IdType.ASSIGN_ID)
    @JsonSerialize(using = ToStringSerializer.class)
    private Long id;

    @Schema(description = "会员id")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long memberId;

    @Schema(description = "乘客id")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long passengerId;

    @Schema(description = "乘客姓名")
    private String passengerName;

    @Schema(description = "日期")
    private LocalDate trainDate;

    @Schema(description = "车次编号")
    private String trainCode;

    @Schema(description = "箱序")
    private Integer carriageIndex;

    @Schema(description = "排号|01, 02")
    private String seatRow;

    @Schema(description = "列号|枚举[SeatColEnum]")
    private String seatCol;

    @Schema(description = "出发站")
    private String startStation;

    @Schema(description = "出发时间")
    private LocalTime startTime;

    @Schema(description = "到达站")
    private String endStation;

    @Schema(description = "到站时间")
    private LocalTime endTime;

    @Schema(description = "座位类型|枚举[SeatTypeEnum]")
    private String seatType;

    @Schema(description = "新增时间")
    private Date createTime;

    @Schema(description = "修改时间")
    private Date updateTime;


}
